<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>高度塌陷</title>
        <style>
            ul{
                border:10px solid black;
            }
            ul::after{
                content:"";
                clear:both;
                display:block;
            }
            li{
                width: 200px;
                height: 300px;
                list-style: none;
                float: left;
            }
            li:first-child{
                background: #4d8000;
            }
            li:last-child{
                background: #00c0a5;
            }
        </style>
    </head>
    <body>
        <ul>
            <li></li>
            <li></li>
        </ul>
    </body>
</html>